# 查看远程编译日志中的错误
# 用法: .\view-errors.ps1 [full]

# 配置
$REMOTE_SERVER = "root@192.168.50.160"
$BUILD_LOG = "/tmp/build.log"

# 检查是否查看完整日志
$viewFull = $false
if ($args.Count -gt 0 -and $args[0] -eq "full") {
    $viewFull = $true
    Write-Host "显示完整构建日志..." -ForegroundColor Yellow
    ssh $REMOTE_SERVER "cat $BUILD_LOG"
} else {
    # 只显示错误和警告
    Write-Host "显示编译错误和警告..." -ForegroundColor Yellow
    ssh $REMOTE_SERVER "cat $BUILD_LOG | grep -E 'error:|warning:' --color=always"
    
    Write-Host "`n要查看完整日志，请运行: .\view-errors.ps1 full" -ForegroundColor Cyan
} 